package com.plian.system.dao.fr.organzationmonthratio;

import com.plian.Tools.pagedata.PageData;
import com.plian.system.dao.DaoSupport;
import com.plian.system.entity.fr.organzationmonthratio.OrganzationMonthRatio;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

/**
* 说明：企业月度指标录入
*/
@Component
public class OrganzationMonthRatioDao {
@Resource(name = "daoSupport")
private DaoSupport dao;

	/**
	* 新增
	* @param organzationMonthRatio
	* @throws Exception
	*/
	public void save(OrganzationMonthRatio organzationMonthRatio) throws Exception {
		dao.save("OrganzationMonthRatioMapper.save",organzationMonthRatio);
	}

	/**
	* 修改
	* @param organzationMonthRatio
	* @throws Exception
	*/
	public void edit(OrganzationMonthRatio organzationMonthRatio) throws Exception {
		dao.update("OrganzationMonthRatioMapper.edit",organzationMonthRatio);
	}

	/**
	 * 根据月份和单位代码返回存贷比，综合融资率信息
	 * @param pageData
	 * @return
	 * @throws Exception
	 */
	public OrganzationMonthRatio findByMonthAndOrgcode(PageData pageData) throws Exception{
		return (OrganzationMonthRatio) dao.findForObject("OrganzationMonthRatioMapper.findByMonthAndOrgcode",pageData);
	}

	/**
	 * 根据月份和父节点返回单位和存款信息
	 * @param pageData
	 * @return
	 * @throws Exception
	 */
	public List<OrganzationMonthRatio> getInfoByPorgId(PageData pageData) throws Exception{
		return (List<OrganzationMonthRatio>)dao.findForList("OrganzationMonthRatioMapper.getInfoByPorgId",pageData);
	}
}